package com.maiyawx.mall.exception;

import com.maiyawx.mall.enums.CommonEnum;

/**
 * 公共异常类
 */
public class CommonException extends RuntimeException {
    private Integer code;

    public void setCode(Integer code) {
        this.code = code;
    }

    public CommonException(CommonEnum commonEnum)
    {
        super(commonEnum.getMessage());
        this.code = commonEnum.getCode();
    }

    public Integer getCode() {
        return code;
    }
}
